<template>
  <ant-modal
    modalWidth="800"
    modalHeight="750"
    :visible="open"
    modal-title="新增客户信息"
    :adjust-size="true"
    @cancel="cancel"
  >
    <a-form-model
      ref="form"
      :model="form"
      :rules="rules"
      slot="content"
      layout="vertical"
    >
      <a-row :gutter="32" style="width: 70%; margin-left: 15%">
        <a-col :span="12">
          <a-form-model-item label="客户名称" prop="cusName">
            <a-input v-model="form.cusName" placeholder="请输入客户名称" />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="电话" prop="phone">
            <a-input v-model="form.phone" placeholder="请输入电话" />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="所在城市(省份-市区)" prop="cityName">
            <a-select
              placeholder="所在城市(省份-市区)"
              v-model="form.cityName"
              style="width: 100%"
              allow-clear
            >
              <a-select-option
                v-for="(d, index) in cityList"
                :key="index"
                :value="d.name.replace('市', '')"
                >{{ d.name }}</a-select-option
              >
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="客户来源" prop="laiyuan">
            <a-select
              placeholder="选择客户来源"
              v-model="form.laiyuan"
              style="width: 100%"
              allow-clear
            >
              <a-select-option
                v-for="(d, index) in busTypeOptions"
                :key="index"
                :value="d.dictValue"
                >{{ d.dictLabel }}</a-select-option
              >
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="申请金额" prop="amount">
            <a-input v-model="form.amount" placeholder="请输入申请金额" />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="车牌号码" prop="carNo">
            <a-input v-model="form.carNo" placeholder="请输入车牌号码" />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="车辆状态" prop="carStatus">
            <a-select
              style="width: 100%"
              v-model="form.carStatus"
              placeholder="选择车辆状态"
            >
              <a-select-option
                v-for="(item, key) in carStatusOptions"
                :key="key"
                :value="item.dictValue"
              >
                {{ item.dictLabel }}
              </a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col
          :span="12"
          v-if="form.carStatus == '按揭车' || form.carStatus == '抵押车'"
        >
          <a-form-model-item label="抵押到期日期" prop="carStatus">
            <a-date-picker
              v-model="form.diyaTime"
              value-format="YYYY-MM-DD"
              placeholder="抵押到期日期"
            />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="上牌日期" prop="">
            <a-date-picker
              v-model="form.fuckCarNoTime"
              value-format="YYYY-MM-DD"
              placeholder="上牌日期"
              style="width: 100%"
            />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="车辆品牌" prop="carModel">
            <a-input v-model="form.carModel" placeholder="车辆品牌" />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="评估价格" prop="pgPrice">
            <a-input-number
              v-model="form.pgPrice"
              placeholder="输入评估价格"
              :min="2"
              :max="500"
              :step="0.5"
              :formatter="(value) => `${value}万`"
              :parser="(value) => value.replace('万', '')"
              style="width: 100%"
              :defaultValue="2"
            />
          </a-form-model-item>
        </a-col>

        <a-col :span="24">
          <a-form-model-item label="备注信息" prop="remark">
            <a-textarea v-model="form.remark" :rows="5"></a-textarea>
          </a-form-model-item>
        </a-col>
      </a-row>
    </a-form-model>

    <template slot="footer">
      <a-button @click="cancel"> 取消 </a-button>
      <a-button type="primary" @click="submitForm" :loading="loading">
        确 定
      </a-button>
    </template>
  </ant-modal>
</template>
<script>
import BizCustomerAddForm from "./BizCustomerForm";
export default {
  ...BizCustomerAddForm,
};
</script>
